﻿using System;
using Unity;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;


namespace AutoRule
{
    class CTimerRuleManager : Singleton<CTimerRuleManager>
    {


        public void Parse()
        {
            List<CTimerRule> l = CDB.GetInstance().ParseTimerRule();
            mutex.WaitOne();
            _list = l;
            mutex.ReleaseMutex();
        }

        public List<CTimerRule> Get()
        {
            mutex.WaitOne();
            List<CTimerRule> l = _list;
            mutex.ReleaseMutex();
            return l;
        }





        private List<CTimerRule> _list;
        Mutex mutex = new Mutex();
    }
}
